<template>
  <div>
    <el-button type="success" @click="add">添加</el-button>
      <v-dialog :info='info' ref="edi"></v-dialog>
      <v-list @edit='edit'></v-list>
  </div>
</template>

<script>
import vDialog from './components/Dialog.vue'
import vList from './components/List.vue'

export default {
  components:{
    vDialog,
    vList
  },
  data() {
    return {
      info:{
        isShow:false,
        title:'',
        isAdd:true
      }
    }
  },
  methods:{
    add(){
      this.info.isShow=true
      this.info.title='添加',
      this.info.isAdd=true
    },
    edit(id){
      this.info.isShow=true
      this.info.title='编辑'
      this.info.isAdd=false
      this.$refs.edi.getone(id)

    }
  },
  mounted(){
        // 设置路由元信息
        document.title = this.$route.meta.title
    }
}
</script>

<style>

</style>